tdf#119685 Fix infinite loop in gtk3_kde5 filepicker
authorMichael Weghorn <m.weghorn@posteo.de>
Wed, 5 Sep 2018 16:03:06 +0000 (18:03 +0200)
committerRene Engelhard <rene@debian.org>
Mon, 10 Sep 2018 21:38:40 +0000 (22:38 +0100)
commitee89c07e6e4a3b170208124a6a9c3d672a0b9ece
tree6904652d8883cb328c09f5ed80e1e4b3044af75a
parente9e6496ee993fcb02ff62b4145b58c2861b22d34
tdf#119685 Fix infinite loop in gtk3_kde5 filepicker

Since 'string::find()' returns the position of the given
character in the string and that was passed as the amount of
characters to delete from the string, 'm_responseBuffer'
would always be a string starting with a newline character
afterwards, when this part of the code was reached.

Subsequent calls to 'Gtk3KDE5FilePickerIpc::readResponseLine'
therefore always returned an empty string and left
'm_responseBuffer' unchanged, resulting in the lambda function
inside 'readResponse' in 'gtk3_kde5_filepicker_ipc.hxx' to
loop infinitely.

While at it, make a little more explicit that 'it' is of type
'size_t' here.

Change-Id: I3b1c209f8307ab71465d9538a82616dff8656415
Reviewed-on: https://gerrit.libreoffice.org/60047
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 1f5698ba8b62e62999b0efb363916a91bdd54c94)
Reviewed-on: https://gerrit.libreoffice.org/60067
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Gbp-Pq: Name fix-gtk3_kde5-filepicker-infinite-loop.diff
vcl/unx/gtk3_kde5/gtk3_kde5_filepicker_ipc.cxx